$(function(){ 
	$("#login").on("click",function(){
		login();
	})
	
	$("input").on("keyup",function(event){
	 if(event.keyCode == 13){
	   login();
	 }
});
	 
	function login(){ 
		var url = URL.FRAMEWORK + "/login/sign"; 
		var username = $("#username").val();
		var password = $("#password").val();
		var validateCode = $("#validateCode").val();
		$.ajax({
			url:url,
			data:{username:username,password:password,validateCode:validateCode},
			type:"POST",
			success:function(data){  
			  window.location.href = URL.WEB_FRAMEWORK + '/templates/index.html';
			}
		})
	}
	
})

